<template>
  <a-drawer
    :title="$t('all.autotext261')"
    :visible="visible"
    :footer="null"
    width="600"
    @close="handleCancel"
  >
    <a-spin :spinning="spinning">
      <a-timeline v-if="list.length > 0">
        <a-timeline-item v-for="(item, i) in list" :key="i">
          <div>{{ item.createTime | moment('YYYY-MM-DD HH:mm') }}</div>
          <div class="line-less">{{ item.activity }}</div>
        </a-timeline-item>
      </a-timeline>
      <a-empty v-else />
    </a-spin>
  </a-drawer>
</template>

<script>
import { activityRecode } from '@/api/overview/member'
export default {
  data () {
    return {
      proId: '',
      visible: false,
      spinning: true,
      list: []
    }
  },
  created () {
    const pd = localStorage.getItem('CURRENT_PROID')
    if (pd) {
      this.proId = parseInt(pd)
    }
  },
  methods: {
    open () {
      this.visible = true
    },
    async getDetail (id) {
      const res = await activityRecode({ teamId: id })
      this.spinning = false
      this.list = res
    },
    handleCancel () {
      this.visible = false
    }
  }
}
</script>

<style lang="less" scoped>
.line-less {
  color: #999;
}
</style>
